<template>
<view class="tab_wrapper flex" :style="'height: ' + (iOSSystem?'150':'110') + 'rpx; padding-bottom: ' + (iOSSystem?'40':'0') + 'rpx;'">
    <view v-for="(item, index) in tabbar.list" :key="index" @tap="jumpFun" class="tab_item" :data-index="index" :data-path="item.pagePath">
        <image class="icon" :src="item.selected?item.selectedIconPath:item.iconPath"></image>
        <view class="text" :style="'color: ' + (item.selected?tabbar.selectedColor:tabbar.color) + ';'">{{item.text}}</view>
    </view>
    <view @tap="signEvent" class="sign_item">
        <image class="arc_line" src="/static/images/arc_line.png"></image>
        <image class="icon" src="/static/images/icon_tab02.png"></image>
        <view class="text">签到</view>
    </view>
</view>
</template>

<script>
var app = getApp();

export default {
  data() {
    return {
      iOSSystem: !1,
      checkAuth: "",
      focusFlag: ""
    };
  },

  components: {},
  props: {
    tabbar: {
      type: Object,
      default: () => {}
    }
  },
  options: {
    addGlobalClass: !0
  },
  beforeMount: function () {
    this.init();
  },
  methods: {
    init: function () {
      var t = this;
      uni.getSystemInfo({
        success: function (a) {
          a.system.indexOf("iOS") > -1 && (t.setData({
            iOSSystem: !0
          }), app.globalData.iOSSystem = !0);
        }
      });
    },
    jumpFun: function (e) {
      var t = e.currentTarget.dataset,
          a = (t.index, t.path);
      a.indexOf("data") > -1 ? this.setData({
        checkAuth: !0,
        focusFlag: !0
      }) : uni.switchTab({
        url: a
      });
    },
    signEvent: function () {
			if (app.globalData.token) {
				uni.navigateTo({
				  url: "/pages/me/act/act"
				});
			} else {
				uni.showModal({
				  title: "温馨提示",
				  content: "您还没有登录",
				  showCancel: !0,
				  cancelText: "再看看",
				  cancelColor: "#777878",
				  confirmText: "去登录",
				  confirmColor: "#24CBA9",
				  success: function (e) {
				    e.confirm && uni.navigateTo({
				      url: "/pages/entry/login"
				    });
				  }
				});
			}
    }
  }
};
</script>
<style>
.tab_wrapper {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 999;
    width: 100%;
    height: 110rpx;
    justify-content: space-between;
    background: #fff;
    border-top: 1rpx solid #e1e2e3;
}

.tab_wrapper .tab_item {
    flex: 0 0 33.33%;
    width: 33.33%;
    height: 110rpx;
    padding-top: 16rpx;
    font-size: 0rpx;
}

.tab_item .icon {
    display: block;
    width: 44rpx;
    height: 44rpx;
    margin: 0 auto 10rpx;
}

.tab_item .text {
    text-align: center;
    font-size: 24rpx;
}

.sign_item {
    position: absolute;
    top: -56rpx;
    left: 50%;
    transform: translateX(-50%);
    width: 136rpx;
    height: calc(100% + 56rpx);
    text-align: center;
    padding-top: 20rpx;
}

.sign_item .arc_line {
    position: absolute;
    top: 5rpx;
    left: 0;
    width: 100%;
    height: 56rpx;
}

.sign_item .icon {
    position: relative;
    z-index: 9;
    width: 96rpx;
    height: 96rpx;
}

.sign_item .text {
    margin-top: 5rpx;
    text-align: center;
    font-size: 22rpx;
    color: #777878;
}
</style>